import { Define, EntityObjectFactory } from 'tiny-entity2';
import { OrganizationTree } from './organizationTree';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "organization" })
export class Organization extends EntityObjectType<Organization>{
    @Define.PrimaryKey()
    id: string;

    /**
     * 单位名称
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    name: string;

    /**
     * 后台系统logo
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    sysLogoUrl: string;

    /**
     * 后台系统名称
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    sysName: string;

    /**
     * 单位联系电话
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    phone: string;

    /**
     * 创建日期
     *
     * @type {number}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    /**
     * 法人代表姓名
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    legalName: string;

    /**
     * 所在省
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    province: string;


    /**
     * 所在城市
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    city: string;

    /**
     * 所在区域
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    area: string;

    /**
     * 详细地址
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    address: string;

    /**
     * 营业执照图片地址
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    businessLicenseUrl: string;

    /**
     * 组织机构代码
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    code: string;

    /**
     * 组织机构代码证图片地址
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    orgCodeUrl: string;

    /**
     * 单位logo图片地址
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    logo: string;

    /**
     * 单位封面图片地址
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    coverUrl: string;

    /**
     * 当前单位状态
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    status: string;

    /**
     * 是否被删除（逻辑删除）
     *
     * @type {boolean}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.BOOL
    })
    isDelete: boolean;

    /**
     * 
     *
     * @type {number}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    modifyTime: number;

    /**
     * 社会统一信用代码
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    creditCode: string;

    /**
     * 单位图片地址列表
     *
     * @type {string[]}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.JSON
    })
    imageList: string[];

    /**
     * 所属行业
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    industry: string;

    /**
     * 上游行业
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    upstreamIndustry: string;

    /**
     * 下游行业
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    downstreamIndustry: string;

    /**
     * 特别说明
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    specialNote: string;

    /**
     * 资费
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    postage: string;

    /**
     * 资费有效期开始
     *
     * @type {number}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    postageTimeBegin: number;

    /**
     * 资费有效期结束
     *
     * @type {number}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    postageTimeEnd: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    fax: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    postcode: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    orgType: string;

    @Define.Column({
        DataType: Define.DataType.JSON
    })
    systemTypes: string[];

    @Define.Column({
        DataType: Define.DataType.JSON
    })
    extends;

    orgTree: OrganizationTree;
}

export const OrganizationStauts = {
    Disable: 'disable'
}